<?php

class ControllerSettingSeourl extends AdminController {
	public function index() {
		$this->document->setTitle($this->_['heading_title']);
		
		$this->data['category_seo_rule'] = C('category_seo_rule');
		$this->data['product_seo_rule'] = C('product_seo_rule');
		$this->data['category_seo_rules'] = $this->_['config_seo_rules']['category'];
		$this->data['product_seo_rules'] = $this->_['config_seo_rules']['product'];
		
		$this->display('setting/seo_url.tpl');
	}
	
	public function save() {				
		if ($this->request->isPost()) {
			
			M('setting/setting');
			$this->model_setting_setting->editSetting('seo_rule', $this->request->post);
			
			$this->session->set_flashdata('success', $this->_['text_success']);
		}
		$this->redirect(UA('setting/seo_url'));
	}
}